package com.apes.auto.car.service;

import com.apes.auto.car.model.WheelHubSpecifications;
import com.apes.auto.car.repository.WheelHubSpecificationsRepository;
import com.apes.framework.api.DomainService;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @ClassName WheelHubSpecificationsService
 * @Description TODO
 * @Author pengyb
 * @Date 2019/7/12 13:58
 * @Version 1.0
 **/
@Service("wheelHubSpecificationsService")
public class WheelHubSpecificationsService extends DomainService {
    @Autowired
    private WheelHubSpecificationsRepository wheelHubSpecificationsRepository;


    public WheelHubSpecifications save(SimpleRequest request) {
        WheelHubSpecifications o = request.getO(WheelHubSpecifications.class);
        return wheelHubSpecificationsRepository.saveAndFlush(o);
    }

    public String delete(SimpleRequest request) {
        WheelHubSpecifications o = request.getO(WheelHubSpecifications.class);
        wheelHubSpecificationsRepository.delete(o.getId());
        return "删除成功";
    }
}
